from common.config_manager import config_manager


class XbotBaseApi:
    def __init__(self, base_url="", wx_id=""):
        self.base_url = base_url  # 不再进行URL规范化，保留原始URL
        self.wx_id=wx_id

    @classmethod
    def init_no_wxid(cls,base_url: str):
        return cls(base_url=base_url, wx_id="")

    @classmethod
    def init_wxid(cls,base_url: str,wx_id:str):
        return cls(base_url=base_url, wx_id=str)


    @classmethod
    def init(cls):
        base_url=config_manager.api_config.api_base_url
        wx_id=config_manager.api_config.wxid
        return cls(base_url=base_url, wx_id=wx_id)